package com.lrkj.phone.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.lrkj.common.annotation.Excel;
import com.lrkj.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * app用户对象 tm_app_user
 *
 * @author yajun_ren
 * @date 2021-04-09
 */
@Data
@ApiModel("APP用户实体类")
public class AppUser extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * app用户ID
     */
    private String appUserId;

    /**
     * 昵称
     */
    @ApiModelProperty("昵称")
    @Excel(name = "昵称")
    private String nickName;

    /**
     * 性别
     */
    @ApiModelProperty("性别")
    @Excel(name = "性别")
    private String gender;

    /**
     * 出生日期
     */
    @ApiModelProperty("出生日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date birthday;

    /**
     * 职业
     */
    @ApiModelProperty("职业")
    @Excel(name = "职业")
    private String occupation;

    /**
     * 证件类型
     */
    @ApiModelProperty("证件类型")
    @Excel(name = "证件类型")
    private String paperType;

    /**
     * 证件号码
     */
    @ApiModelProperty("证件号码")
    @Excel(name = "证件号码")
    private String paperNumber;

    /**
     * openId
     */
    @ApiModelProperty("openId")
    @Excel(name = "openId")
    private String openId;

    /**
     * 账号
     */
    @ApiModelProperty("账号")
    @Excel(name = "账号")
    private String account;

    /**
     * 密码
     */
    @ApiModelProperty("密码")
    @Excel(name = "密码")
    private String password;

    /**
     * 头像
     */
    @ApiModelProperty("头像")
    @Excel(name = "头像")
    private String headPortrait;

    /**
     * 手机号码
     */
    @ApiModelProperty("手机号码")
    @Excel(name = "手机号码")
    private Long cellPhoneNumber;

    /**
     * 数据状态（0正常 1停用）
     */
    @Excel(name = "数据状态", readConverterExp = "0=正常,1=停用")
    private String statusCd;

    /**
     * 个性签名
     */
    @ApiModelProperty("个性签名")
    @Excel(name = "个性签名")
    private String personalSignature;


    public AppUser() {

    }

    public AppUser(String openId, Long cellPhoneNumber) {
        this.openId = openId;
        this.cellPhoneNumber = cellPhoneNumber;
    }


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("appUserId", getAppUserId())
                .append("nickName", getNickName())
                .append("gender", getGender())
                .append("birthday", getBirthday())
                .append("occupation", getOccupation())
                .append("paperType", getPaperType())
                .append("paperNumber", getPaperNumber())
                .append("openId", getOpenId())
                .append("account", getAccount())
                .append("password", getPassword())
                .append("headPortrait", getHeadPortrait())
                .append("cellPhoneNumber", getCellPhoneNumber())
                .append("statusCd", getStatusCd())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("personalSignature", getPersonalSignature())
                .toString();
    }
}
